package com.shangye.core;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Application {

    private ServerSocket serverSocket ;

    public Application ()
    {
        try {
            System.out.println("启动》》");
            serverSocket = new ServerSocket(8088);
            System.out.println("启动完毕");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    public void start() {
        try {
            System.out.println("等代连接...");
            Socket socket = serverSocket.accept();
            new Thread(new ClientHandler(socket)).start();
            System.out.println("连接成功!");

        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public static void main(String[] args) {
        new Application().start();
    }


}
